package com.ifonly.upload;

import java.io.File;

/**
 * @author <a href="mailto:ifonlymaster@163.com">ifonly</a>
 * @version 1.0 2015-12-11 17:36
 * @since JDK 1.6
 */
public class IFile {
    private String parameter;
    private String saveDirectory;
    private String originalFileName;
    private String fileName;
    private String contentType;

    public IFile(String parameter, String saveDirectory, String originalFileName, String fileName, String contentType) {
        this.parameter = parameter;
        this.saveDirectory = saveDirectory;
        this.originalFileName = originalFileName;
        this.fileName = fileName;
        this.contentType = contentType;
    }

    public String getParameter() {
        return parameter;
    }

    public String getOriginalFileName() {
        return originalFileName;
    }

    public String getFileName() {
        return fileName;
    }

    public String getContentType() {
        return contentType;
    }

    public String getSaveDirectory() {
        return saveDirectory;
    }

    public File getFile() {
        if (saveDirectory == null || fileName == null) {
            return null;
        } else {
            return new File(saveDirectory, fileName);
        }
    }
}
